package cn.gan.loveofsoul.entity.constants;

/**
 * @Description:
 * @Author: ganwh
 * @Since: 2023/10/13 17:14
 */
public enum UserFlagEnum {

    NORMAL(0, "新用户"),

    DISABLE(1, "老用户"),;

    private final Integer code;
    private final String name;

    UserFlagEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }


    public String getName() {
        return name;
    }

    public static String getName(Integer code) {

        UserFlagEnum[] values = values();
        for (UserFlagEnum enums : values) {
            if (enums.getCode().equals(code)) {
                return enums.getName();
            }
        }
        return null;
    }
}
